load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/ut_string.ncl"
load "/public/users/wrf/Codes/WRF_scripts/utils/substring.ncl"
load "/public/users/wrf/Codes/WRF_scripts/utils/WRF_dyy_contributed.ncl"


; open csv file to generate the polygon
csvfile = "/public/users/wrf/Data/WuJiang_Map/wujiang_watershed_boundary.csv"
polygon = readAsciiTable(csvfile,2,"float",1)
dim_polygon = dimsizes(polygon)
print(dim_polygon)

point = (/107.0, 27.0/)
point = (/95.682129, 43.439682/)
result = is_point_in_polygon(point, polygon,dim_polygon(0))
print(result)
